#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

void check_bounds(int value, int limit) {
    //printf("\nChecking 0 <= %d < %d\n", value, limit);
    //fflush(stdout);
    if (value >= limit || value < 0) {
        fprintf(stderr, "Illegal Array Access !! 0 < = %d < %d failed !!\n", value, limit);
        exit(1);
    }
}

void debug_func(int value) {
    printf("\n*** %d ***\n", value);
}

void dyn_check_bounds(int value, int baseLim, int divisor) {
    check_bounds(value, baseLim / divisor);
}
